package com.uzai.common.enums;

/**
 * 奖励规则
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum RewardRuleEnum {

    PRI(0,"定向"),
    NUSER(1,"杀熟"),
    NORMAL(2,"常规");

    public static final int PRI_VALUE = 0;
    public static final int NUSER_VALUE = 1;
    public static final int NORMAL_VALUE = 2;
    private Integer value;
    private String desc;

    RewardRuleEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static RewardRuleEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (RewardRuleEnum type: RewardRuleEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
